a,b = input().split(),input().split()
list1,list2 = [eval(x) for x in a],[eval(x) for x in b]
list3 = list1 + list2
list3.sort()
for x in list3:
    print(x, end=' ')
